<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>闲置无线耳机转让 - 详情</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #3b82f6;
            --primary-light: #60a5fa;
            --primary-dark: #2563eb;
            --secondary: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --bg-light: #f8fafc;
            --bg-white: #ffffff;
            --bg-gray: #f1f5f9;
            --bg-gray-dark: #e2e8f0;
            --border-light: #e2e8f0;
            --border-medium: #cbd5e1;
            --radius: 12px;
            --radius-sm: 8px;
            --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 60px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            border-bottom: 1px solid var(--border-light);
        }
        
        .nav-title {
            font-size: 1.1rem;
            font-weight: 600;
            text-align: center;
            flex: 1;
        }
        
        .nav-action {
            color: var(--text-secondary);
            background: none;
            border: none;
            font-size: 1.2rem;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .nav-action:hover {
            background-color: var(--bg-light);
        }
        
        .nav-action.primary {
            color: var(--primary);
        }
        
        /* 图片预览区 */
        .image-preview {
            position: relative;
            background-color: black;
        }
        
        .preview-image {
            width: 100%;
            height: 300px;
            object-fit: contain;
            background-color: black;
        }
        
        .image-count {
            position: absolute;
            top: 12px;
            right: 12px;
            background-color: rgba(0, 0, 0, 0.5);
            color: white;
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 0.8rem;
        }
        
        .image-nav {
            display: flex;
            gap: 4px;
            padding: 8px;
            background-color: black;
            overflow-x: auto;
        }
        
        .image-thumb {
            width: 60px;
            height: 60px;
            border-radius: 6px;
            object-fit: cover;
            opacity: 0.7;
            border: 2px solid transparent;
        }
        
        .image-thumb.active {
            opacity: 1;
            border-color: var(--primary);
        }
        
        /* 供给信息区 */
        .supply-info {
            padding: 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .supply-title {
            font-size: 1.2rem;
            font-weight: 600;
            margin-bottom: 12px;
            line-height: 1.4;
        }
        
        .price-container {
            margin-bottom: 12px;
        }
        
        .supply-price {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--danger);
        }
        
        .price-unit {
            font-size: 1rem;
            margin-left: 4px;
        }
        
        .supply-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 16px;
        }
        
        .supply-tag {
            background-color: var(--bg-gray);
            color: var(--text-secondary);
            padding: 4px 12px;
            border-radius: 16px;
            font-size: 0.8rem;
        }
        
        .supply-meta {
            display: flex;
            justify-content: space-between;
            font-size: 0.85rem;
            color: var(--text-tertiary);
        }
        
        .meta-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        /* 提供者信息 */
        .provider-info {
            padding: 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .provider-avatar {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .provider-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .provider-details {
            flex: 1;
        }
        
        .provider-name {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
        }
        
        .verify-badge {
            color: var(--primary);
            font-size: 0.8rem;
            margin-left: 4px;
        }
        
        .provider-meta {
            font-size: 0.8rem;
            color: var(--text-tertiary);
            display: flex;
            gap: 12px;
        }
        
        .contact-btn {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
        }
        
        /* 详情描述 */
        .supply-description {
            padding: 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            margin-bottom: 12px;
        }
        
        .section-title {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 12px;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .section-title i {
            color: var(--primary);
        }
        
        .description-content {
            font-size: 0.95rem;
            line-height: 1.6;
            color: var(--text-secondary);
        }
        
        .description-images {
            margin-top: 12px;
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }
        
        .description-image {
            width: 100%;
            border-radius: var(--radius-sm);
            aspect-ratio: 1;
            object-fit: cover;
        }
        
        /* 详情属性 */
        .supply-attributes {
            padding: 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
            margin-bottom: 12px;
        }
        
        .attribute-list {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }
        
        .attribute-item {
            font-size: 0.9rem;
        }
        
        .attribute-label {
            color: var(--text-tertiary);
            margin-bottom: 4px;
            font-size: 0.85rem;
        }
        
        .attribute-value {
            color: var(--text-primary);
            font-weight: 500;
        }
        
        /* 留言区 */
        .comments-section {
            padding: 16px;
            background-color: var(--bg-white);
        }
        
        .comments-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 16px;
        }
        
        .comments-count {
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .sort-comments {
            font-size: 0.85rem;
            color: var(--primary);
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .comment-form {
            display: flex;
            gap: 10px;
            margin-bottom: 24px;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: var(--bg-gray);
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .user-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .comment-input-container {
            flex: 1;
        }
        
        .comment-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border-light);
            border-radius: 20px;
            font-size: 0.9rem;
            resize: none;
            height: 40px;
            margin-bottom: 8px;
        }
        
        .comment-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }
        
        .comment-action-btn {
            background: none;
            border: none;
            color: var(--text-tertiary);
            font-size: 0.9rem;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .submit-comment {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 4px 16px;
            border-radius: 16px;
            font-size: 0.85rem;
            font-weight: 500;
        }
        
        /* 留言列表 */
        .comments-list {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .comment-item {
            display: flex;
            gap: 10px;
        }
        
        .comment-content {
            flex: 1;
        }
        
        .comment-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 6px;
        }
        
        .comment-author {
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .comment-time {
            font-size: 0.75rem;
            color: var(--text-tertiary);
        }
        
        .comment-text {
            font-size: 0.9rem;
            line-height: 1.5;
            background-color: var(--bg-gray);
            padding: 8px 12px;
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
        }
        
        .comment-actions {
            display: flex;
            gap: 16px;
            font-size: 0.8rem;
        }
        
        .comment-action {
            color: var(--text-tertiary);
            background: none;
            border: none;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .comment-action.liked {
            color: var(--danger);
        }
        
        /* 回复区域 */
        .replies-container {
            margin-left: 30px;
            margin-top: 12px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .reply-item {
            display: flex;
            gap: 8px;
        }
        
        .reply-content {
            flex: 1;
        }
        
        .reply-text {
            font-size: 0.85rem;
            line-height: 1.4;
            background-color: var(--bg-gray);
            padding: 6px 10px;
            border-radius: var(--radius-sm);
            margin-bottom: 6px;
        }
        
        .reply-author {
            font-weight: 500;
            color: var(--primary);
        }
        
        /* 底部操作栏 */
        .bottom-actions {
            position: fixed;
            bottom: 60px;
            left: 0;
            right: 0;
            padding: 10px 16px;
            background-color: var(--bg-white);
            border-top: 1px solid var(--border-light);
            display: flex;
            gap: 10px;
        }
        
        .action-btn {
            flex: 1;
            padding: 10px 0;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .primary-action {
            background-color: var(--primary);
            color: white;
        }
        
        .secondary-action {
            background-color: var(--bg-gray);
            color: var(--text-secondary);
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: 0.7rem;
            gap: 4px;
            flex: 1;
            height: 100%;
            text-decoration: none;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 1.2rem;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 140px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 4px;
            z-index: 9999;
            font-size: 0.85rem;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 加载更多评论 */
        .load-more-comments {
            text-align: center;
            padding: 12px 0;
        }
        
        .load-more-btn {
            background: none;
            border: 1px solid var(--border-light);
            color: var(--text-secondary);
            padding: 6px 20px;
            border-radius: 16px;
            font-size: 0.85rem;
        }
        
        /* 回复输入框 */
        .reply-form {
            display: flex;
            gap: 8px;
            margin-top: 8px;
        }
        
        .reply-input {
            flex: 1;
            padding: 6px 10px;
            border: 1px solid var(--border-light);
            border-radius: 16px;
            font-size: 0.85rem;
            resize: none;
            height: 34px;
        }
        
        .submit-reply {
            background-color: var(--primary);
            color: white;
            border: none;
            padding: 0 12px;
            border-radius: 14px;
            font-size: 0.8rem;
            align-self: flex-end;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-action" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">供给详情</div>
        <button class="nav-action" id="shareBtn">
            <i class="fas fa-share-alt"></i>
        </button>
    </div>
    
    <!-- 图片预览区 -->
    <div class="image-preview">
        <img src="https://picsum.photos/id/96/800/600" alt="无线耳机" class="preview-image" id="mainImage">
        <div class="image-count">1/3</div>
        <div class="image-nav">
            <img src="https://picsum.photos/id/96/200/200" alt="无线耳机" class="image-thumb active" data-index="0">
            <img src="https://picsum.photos/id/201/200/200" alt="耳机细节" class="image-thumb" data-index="1">
            <img src="https://picsum.photos/id/119/200/200" alt="配件" class="image-thumb" data-index="2">
        </div>
    </div>
    
    <!-- 供给信息区 -->
    <div class="supply-info">
        <h1 class="supply-title">闲置无线耳机转让，9成新，续航约8小时，音质良好</h1>
        
        <div class="price-container">
            <span class="supply-price">¥350</span>
            <span class="price-unit">可议价</span>
        </div>
        
        <div class="supply-tags">
            <span class="supply-tag">电子数码</span>
            <span class="supply-tag">耳机</span>
            <span class="supply-tag">闲置转让</span>
            <span class="supply-tag">可配送</span>
        </div>
        
        <div class="supply-meta">
            <div class="meta-item">
                <i class="fas fa-clock"></i>
                <span>2小时前发布</span>
            </div>
            <div class="meta-item">
                <i class="fas fa-map-marker-alt"></i>
                <span>1.2km</span>
            </div>
        </div>
    </div>
    
    <!-- 提供者信息 -->
    <div class="provider-info">
        <div class="provider-avatar">
            <img src="https://picsum.photos/id/64/100/100" alt="张小明">
        </div>
        <div class="provider-details">
            <div class="provider-name">
                张小明 <i class="fas fa-check-circle verify-badge"></i>
            </div>
            <div class="provider-meta">
                <span>3.2km</span>
                <span>4.9分 (128评价)</span>
                <span>已认证</span>
            </div>
        </div>
        <button class="contact-btn" id="contactProviderBtn">
            <i class="fas fa-comment"></i>
            <span>联系TA</span>
        </button>
    </div>
    
    <!-- 详情描述 -->
    <div class="supply-description">
        <h2 class="section-title">
            <i class="fas fa-align-left"></i>
            详细描述
        </h2>
        <div class="description-content">
            闲置无线蓝牙耳机转让，购买于半年前，使用较少，9成新。<br><br>
            主要特点：
            - 续航约8小时，充电盒可额外充电3次
            - 支持主动降噪功能
            - 音质良好，低音表现优秀
            - 佩戴舒适，适合长时间使用
            - 支持无线充电<br><br>
            配件齐全，包含原装充电盒、充电线、替换耳塞三对。<br><br>
            可小刀，支持同城面交或快递（运费自理）。有意者请联系。
        </div>
        <div class="description-images">
            <img src="https://picsum.photos/id/96/300/300" alt="耳机展示" class="description-image">
            <img src="https://picsum.photos/id/201/300/300" alt="配件展示" class="description-image">
        </div>
    </div>
    
    <!-- 详情属性 -->
    <div class="supply-attributes">
        <h2 class="section-title">
            <i class="fas fa-list-ul"></i>
            基本属性
        </h2>
        <div class="attribute-list">
            <div class="attribute-item">
                <div class="attribute-label">品牌</div>
                <div class="attribute-value">某知名品牌</div>
            </div>
            <div class="attribute-item">
                <div class="attribute-label">成色</div>
                <div class="attribute-value">9成新</div>
            </div>
            <div class="attribute-item">
                <div class="attribute-label">购买时间</div>
                <div class="attribute-value">半年前</div>
            </div>
            <div class="attribute-item">
                <div class="attribute-label">是否保修</div>
                <div class="attribute-value">无保修</div>
            </div>
            <div class="attribute-item">
                <div class="attribute-label">交易方式</div>
                <div class="attribute-value">同城面交/快递</div>
            </div>
            <div class="attribute-item">
                <div class="attribute-label">是否支持退换</div>
                <div class="attribute-value">不支持</div>
            </div>
        </div>
    </div>
    
    <!-- 留言区 -->
    <div class="comments-section">
        <div class="comments-header">
            <div class="comments-count">24条留言</div>
            <button class="sort-comments">
                <span>最新</span>
                <i class="fas fa-chevron-down"></i>
            </button>
        </div>
        
        <!-- 留言输入框 -->
        <div class="comment-form">
            <div class="user-avatar">
                <img src="https://picsum.photos/id/1005/100/100" alt="我的头像">
            </div>
            <div class="comment-input-container">
                <textarea class="comment-input" placeholder="写下你的留言..."></textarea>
                <div class="comment-actions">
                    <button class="comment-action-btn">
                        <i class="far fa-image"></i>
                    </button>
                    <button class="comment-action-btn">
                        <i class="far fa-smile"></i>
                    </button>
                    <button class="submit-comment" id="submitCommentBtn">发送</button>
                </div>
            </div>
        </div>
        
        <!-- 留言列表 -->
        <div class="comments-list">
            <!-- 留言1 -->
            <div class="comment-item">
                <div class="user-avatar">
                    <img src="https://picsum.photos/id/1012/100/100" alt="用户头像">
                </div>
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">李小华</div>
                        <div class="comment-time">1小时前</div>
                    </div>
                    <div class="comment-text">请问最低多少钱可以出？有意购买</div>
                    <div class="comment-actions">
                        <button class="comment-action reply-btn" data-id="1">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </button>
                        <button class="comment-action like-btn" data-id="1">
                            <i class="far fa-heart"></i>
                            <span>12</span>
                        </button>
                    </div>
                    
                    <!-- 回复区 -->
                    <div class="replies-container">
                        <div class="reply-item">
                            <div class="user-avatar">
                                <img src="https://picsum.photos/id/64/100/100" alt="作者头像">
                            </div>
                            <div class="reply-content">
                                <div class="comment-header">
                                    <div class="comment-author">张小明 <span style="color:var(--text-tertiary);font-weight:normal">回复</span> 李小华</div>
                                    <div class="comment-time">45分钟前</div>
                                </div>
                                <div class="reply-text">
                                    <span class="reply-author">@李小华</span> 最低320元，不议价了
                                </div>
                                <div class="comment-actions">
                                    <button class="comment-action reply-btn" data-id="1-1">
                                        <i class="far fa-comment"></i>
                                        <span>回复</span>
                                    </button>
                                    <button class="comment-action like-btn" data-id="1-1">
                                        <i class="far fa-heart"></i>
                                        <span>3</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 回复输入框 (默认隐藏) -->
                        <div class="reply-form" id="replyForm-1" style="display:none">
                            <textarea class="reply-input" placeholder="回复 @李小华..."></textarea>
                            <button class="submit-reply" data-id="1">发送</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 留言2 -->
            <div class="comment-item">
                <div class="user-avatar">
                    <img src="https://picsum.photos/id/1027/100/100" alt="用户头像">
                </div>
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">王大力</div>
                        <div class="comment-time">3小时前</div>
                    </div>
                    <div class="comment-text">音质怎么样？降噪效果好吗？</div>
                    <div class="comment-actions">
                        <button class="comment-action reply-btn" data-id="2">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </button>
                        <button class="comment-action like-btn" data-id="2">
                            <i class="far fa-heart"></i>
                            <span>8</span>
                        </button>
                    </div>
                    
                    <!-- 回复区 -->
                    <div class="replies-container">
                        <div class="reply-item">
                            <div class="user-avatar">
                                <img src="https://picsum.photos/id/64/100/100" alt="作者头像">
                            </div>
                            <div class="reply-content">
                                <div class="comment-header">
                                    <div class="comment-author">张小明 <span style="color:var(--text-tertiary);font-weight:normal">回复</span> 王大力</div>
                                    <div class="comment-time">2小时前</div>
                                </div>
                                <div class="reply-text">
                                    <span class="reply-author">@王大力</span> 音质不错，降噪效果在同价位里算好的，日常通勤用足够了
                                </div>
                                <div class="comment-actions">
                                    <button class="comment-action reply-btn" data-id="2-1">
                                        <i class="far fa-comment"></i>
                                        <span>回复</span>
                                    </button>
                                    <button class="comment-action like-btn" data-id="2-1">
                                        <i class="far fa-heart"></i>
                                        <span>2</span>
                                    </button>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 回复输入框 (默认隐藏) -->
                        <div class="reply-form" id="replyForm-2" style="display:none">
                            <textarea class="reply-input" placeholder="回复 @王大力..."></textarea>
                            <button class="submit-reply" data-id="2">发送</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 留言3 -->
            <div class="comment-item">
                <div class="user-avatar">
                    <img src="https://picsum.photos/id/1025/100/100" alt="用户头像">
                </div>
                <div class="comment-content">
                    <div class="comment-header">
                        <div class="comment-author">赵小丽</div>
                        <div class="comment-time">昨天 18:45</div>
                    </div>
                    <div class="comment-text">可以同城面交吗？我在高新区</div>
                    <div class="comment-actions">
                        <button class="comment-action reply-btn" data-id="3">
                            <i class="far fa-comment"></i>
                            <span>回复</span>
                        </button>
                        <button class="comment-action like-btn" data-id="3">
                            <i class="far fa-heart"></i>
                            <span>5</span>
                        </button>
                    </div>
                    
                    <!-- 回复输入框 (默认隐藏) -->
                    <div class="reply-form" id="replyForm-3" style="display:none">
                        <textarea class="reply-input" placeholder="回复 @赵小丽..."></textarea>
                        <button class="submit-reply" data-id="3">发送</button>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 加载更多评论 -->
        <div class="load-more-comments">
            <button class="load-more-btn" id="loadMoreCommentsBtn">
                加载更多评论
            </button>
        </div>
    </div>
    
    <!-- 底部操作栏 -->
    <div class="bottom-actions">
        <button class="action-btn secondary-action" id="favoriteBtn">
            <i class="far fa-heart"></i>
            <span>收藏</span>
        </button>
        <button class="action-btn secondary-action" id="reportBtn">
            <i class="fas fa-flag"></i>
            <span>举报</span>
        </button>
        <button class="action-btn primary-action" id="buyNowBtn">
            <i class="fas fa-shopping-cart"></i>
            <span>立即购买</span>
        </button>
    </div>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-box-open nav-icon"></i>
            <span>供给</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-bell nav-icon"></i>
            <span>通知</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息元素 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const shareBtn = document.getElementById('shareBtn');
        const contactProviderBtn = document.getElementById('contactProviderBtn');
        const favoriteBtn = document.getElementById('favoriteBtn');
        const reportBtn = document.getElementById('reportBtn');
        const buyNowBtn = document.getElementById('buyNowBtn');
        const submitCommentBtn = document.getElementById('submitCommentBtn');
        const loadMoreCommentsBtn = document.getElementById('loadMoreCommentsBtn');
        const replyBtns = document.querySelectorAll('.reply-btn');
        const submitReplyBtns = document.querySelectorAll('.submit-reply');
        const likeBtns = document.querySelectorAll('.like-btn');
        const imageThumbs = document.querySelectorAll('.image-thumb');
        const mainImage = document.getElementById('mainImage');
        const imageCount = document.querySelector('.image-count');
        
        // 图片预览切换
        const images = [
            'https://picsum.photos/id/96/800/600',
            'https://picsum.photos/id/201/800/600',
            'https://picsum.photos/id/119/800/600'
        ];
        
        imageThumbs.forEach(thumb => {
            thumb.addEventListener('click', function() {
                const index = parseInt(this.dataset.index);
                
                // 更新主图
                mainImage.src = images[index];
                
                // 更新缩略图状态
                imageThumbs.forEach(t => t.classList.remove('active'));
                this.classList.add('active');
                
                // 更新图片计数
                imageCount.textContent = `${index + 1}/${images.length}`;
            });
        });
        
        // 回复按钮点击
        replyBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                const id = this.dataset.id;
                const replyForm = document.getElementById(`replyForm-${id}`);
                
                // 隐藏所有回复框
                document.querySelectorAll('.reply-form').forEach(form => {
                    form.style.display = 'none';
                });
                
                // 显示当前回复框
                if (replyForm) {
                    replyForm.style.display = 'flex';
                    replyForm.querySelector('.reply-input').focus();
                }
            });
        });
        
        // 提交回复
        submitReplyBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                const id = this.dataset.id;
                const replyForm = document.getElementById(`replyForm-${id}`);
                const input = replyForm.querySelector('.reply-input');
                const content = input.value.trim();
                
                if (content) {
                    showToast('回复成功');
                    input.value = '';
                    replyForm.style.display = 'none';
                    
                    // 这里可以添加回复成功后更新UI的逻辑
                } else {
                    showToast('回复内容不能为空');
                }
            });
        });
        
        // 点赞功能
        likeBtns.forEach(btn => {
            btn.addEventListener('click', function() {
                const icon = this.querySelector('i');
                const countElem = this.querySelector('span');
                let count = parseInt(countElem.textContent);
                
                if (icon.classList.contains('far')) {
                    // 点赞
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    this.classList.add('liked');
                    countElem.textContent = count + 1;
                    showToast('点赞成功');
                } else {
                    // 取消点赞
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    this.classList.remove('liked');
                    countElem.textContent = count - 1;
                    showToast('已取消点赞');
                }
            });
        });
        
        // 收藏功能
        favoriteBtn.addEventListener('click', function() {
            const icon = this.querySelector('i');
            
            if (icon.classList.contains('far')) {
                icon.classList.remove('far');
                icon.classList.add('fas');
                this.classList.add('primary-action');
                this.classList.remove('secondary-action');
                showToast('收藏成功');
            } else {
                icon.classList.remove('fas');
                icon.classList.add('far');
                this.classList.remove('primary-action');
                this.classList.add('secondary-action');
                showToast('已取消收藏');
            }
        });
        
        // 提交评论
        submitCommentBtn.addEventListener('click', function() {
            const input = document.querySelector('.comment-input');
            const content = input.value.trim();
            
            if (content) {
                showToast('评论成功');
                input.value = '';
                
                // 这里可以添加评论成功后更新UI的逻辑
            } else {
                showToast('评论内容不能为空');
            }
        });
        
        // 加载更多评论
        loadMoreCommentsBtn.addEventListener('click', function() {
            this.textContent = '加载中...';
            this.disabled = true;
            
            setTimeout(() => {
                this.textContent = '加载更多评论';
                this.disabled = false;
                showToast('已加载全部评论');
            }, 1500);
        });
        
        // 其他按钮事件
        backBtn.addEventListener('click', function() {
            history.back();
        });
        
        shareBtn.addEventListener('click', function() {
            showToast('分享功能已打开');
        });
        
        contactProviderBtn.addEventListener('click', function() {
            showToast('正在打开聊天窗口...');
        });
        
        reportBtn.addEventListener('click', function() {
            showToast('举报功能已打开');
        });
        
        buyNowBtn.addEventListener('click', function() {
            showToast('购买流程已启动');
        });
        
        // 提示消息功能
        function showToast(message) {
            const toast = document.getElementById('toast');
            toast.textContent = message;
            toast.classList.add('show');
            
            setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
    </script>
</body>
</html>

